import type { RouteRecordRaw } from "vue-router";

interface A {
  [X: string]: any;
}

const appRouters: RouteRecordRaw[] = [];

let modules: A = import.meta.glob("./module/*.ts");
Object.keys(modules).forEach((item) => {
  modules[item]().then((module: any) => {
    const defaultModule = module.default;
    if (!defaultModule) return;
    Array.isArray(modules)
      ? appRouters.push(...defaultModule)
      : appRouters.push(defaultModule);
  });
});

console.log("appRouters", appRouters);

export default appRouters;
